package bb.lanxing.model.database;

import com.alibaba.fastjson.annotation.JSONField;

import com.orm.query.Select;

import org.litepal.LitePal;
import org.litepal.crud.LitePalSupport;

import java.util.logging.Level;

import bb.lanxing.util.DateUtil;

public class LevelHP extends LitePalTableBase {
    @JSONField(name = "bang_create")
    private int bangCreate;
    @JSONField(name = "team_create")
    private int clubCreate;
    @JSONField(name = "lushu_download")
    private int lushuDownload;
    private long updateTime;
    private long userId;
    @JSONField(name = "workout_3d")
    private int workout3D;
    @JSONField(name = "workout_export")
    private int workoutExport;

    public static LevelHP getByUserId(long j) {

        String userId = String.valueOf(j);
        LevelHP l = LitePal.where("userId=?", userId).findFirst(LevelHP.class);
        return l;

//        return (LevelHP) Select.from(LevelHP.class).where("user_id = ?", new String[]{String.valueOf(j)}).first();
    }

    public boolean isExpired() {
        return !DateUtil.isSameDay(System.currentTimeMillis(), this.updateTime);
    }

    public String toString() {
        return "workoutExport: " + this.workoutExport + ", workout3D: " + this.workout3D + ", lushuDownload: " + this.lushuDownload + ", clubCreate: " + this.clubCreate + ", bangCreate: " + this.bangCreate;
    }



    public int getWorkoutExport() {
        return this.workoutExport;
    }

    public void setWorkoutExport(int i) {
        this.workoutExport = i;
    }

    public int getWorkout3D() {
        return this.workout3D;
    }

    public void setWorkout3D(int i) {
        this.workout3D = i;
    }

    public int getLushuDownload() {
        return this.lushuDownload;
    }

    public void setLushuDownload(int i) {
        this.lushuDownload = i;
    }

    public int getClubCreate() {
        return this.clubCreate;
    }

    public void setClubCreate(int i) {
        this.clubCreate = i;
    }

    public int getBangCreate() {
        return this.bangCreate;
    }

    public void setBangCreate(int i) {
        this.bangCreate = i;
    }

    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long j) {
        this.userId = j;
    }

    public long getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(long j) {
        this.updateTime = j;
    }
}
